package oocl.custormer.servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import oocl.custormer.po.Merchant;
import oocl.custormer.service.MerchantService;
import oocl.custormer.serviceimpl.MerchantServiceImpl;

/**
 * Servlet implementation class MerchantServlet
 */
public class MerchantServlet extends HttpServlet{
	private MerchantService mm=new MerchantServiceImpl();
	 
	public MerchantServlet() {
	        super();
	    }
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
	List<Merchant> ms=mm.findAllMerchant();
	//System.out.println("List Merchant Size:" + ms.size());
	req.setAttribute("ms", ms);
	req.getRequestDispatcher("listAllMerchant.jsp").forward(req, resp);
	
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
	// TODO Auto-generated method stub
	doGet(req, resp);
}
}
